using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebControls;
using BusinessLayer;

public partial class Admin_reportReferrers : SFPage
{
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        this.Validate();
        if (this.HasErrors)
        {
            MessageBoxShow(this.ErrorMessage);
            return;
        }
        sfgReportTopVisitedPages.LoadGridData();
        sfgReportPageViews.LoadGridData();
        sfgReportPageViewsLanguageDetailed.LoadGridData();
        sfgReportReferrers.LoadGridData();
    }
    protected bool sfgReportTopVisitedPages_NeedsDataSource()
    {
        this.Validate();
        if (!this.HasErrors)
        {
            busReferrers insBusReferrers = new busReferrers();
            DataTable insDataTableReferrers = insBusReferrers.ReportTopVisitedPages(calStartDate.Value.Value, calEndDate.Value.Value);
            sfgReportTopVisitedPages.SetData(insDataTableReferrers);
        }
        return true;
    }
    protected bool sfgReportPageViews_NeedsDataSource()
    {
        this.Validate();
        if (!this.HasErrors)
        {
            busReferrers insBusReferrers = new busReferrers();
            DataTable insDataTableReferrers = insBusReferrers.ReportPageViews(calStartDate.Value.Value, calEndDate.Value.Value);
            sfgReportPageViews.SetData(insDataTableReferrers);
        }
        return true;
    }
    protected bool sfgReportPageViewsLanguageDetailed_NeedsDataSource()
    {
        this.Validate();
        if (!this.HasErrors)
        {
            busReferrers insBusReferrers = new busReferrers();
            DataTable insDataTableReferrers = insBusReferrers.ReportPageViewsLanguageDetailed(calStartDate.Value.Value, calEndDate.Value.Value);
            sfgReportPageViewsLanguageDetailed.SetData(insDataTableReferrers);
        }
        return true;
    }
    protected bool sfgReportReferrers_NeedsDataSource()
    {
        this.Validate();
        if (!this.HasErrors)
        {
            busReferrers insBusReferrers = new busReferrers();
            DataTable insDataTableReferrers = insBusReferrers.ReportReferrers(calStartDate.Value.Value, calEndDate.Value.Value);
            sfgReportReferrers.SetData(insDataTableReferrers);
        }
        return true;
    }
}
